package app.modules.cloudpivot.service.impl;

import java.util.Arrays;

import org.springframework.stereotype.Service;

import com.authine.cloudpivot.engine.enums.type.MessageSettingType;
import com.authine.cloudpivot.engine.service.message.IMessageDesigntimeService;
import com.authine.cloudpivot.engine.service.message.model.IMessageMetaData;
import com.authine.cloudpivot.engine.service.message.model.IMessageSetting;

/**
 * 自定义消息通道
 *
 * @author LiuGangQiang Create in 2024/02/28
 */
@Service
public class WxPusherConfigServiceImpl implements IMessageDesigntimeService {
    private static final IMessageMetaData METADATA;
    private static final IMessageSetting SETTING;

    @Override
    public IMessageMetaData getConfig() {
        return METADATA;
    }

    @Override
    public IMessageSetting getSettingConfig() {
        return SETTING;
    }

    @Override
    public Boolean checkMessageSetting(IMessageSetting iMessageSetting) {
        return true;
    }

    static {
        METADATA = new IMessageMetaData("WxPusher", "WxPusher", "WxPusher推送", MessageSettingType.BuildOut);
        SETTING = new IMessageSetting("WxPusher", Arrays.asList(new IMessageSetting.Parameter("AppToken", "AppToken", "平台TOKEN", true,
                true), new IMessageSetting.Parameter("TopicId", "TopicId", "主题ID", true, true)));
    }
}
